package com.vains.client;

import com.vains.constant.ApplicationNameConstants;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.Map;

/**
 * 认证中心客户端
 *
 * @author vains
 * @date 2021/4/7 9:15
 */
@FeignClient(value = ApplicationNameConstants.AUTH_SERVER_NAME)
public interface AuthClient {

    /**
     * 代理认证服务器 /oauth/token 接口
     * @param parameters 参数
     * @return 返回统一响应类(认证服务器做过处理)
     */
    @PostMapping(value = "/oauth/token", headers = {"Content-Type: application/x-www-form-urlencoded"})
    Map<String, Object> postAccessToken(@RequestBody MultiValueMap<String, String> parameters);

}
